package qc.module.qms.algorithm.NumericCalc.method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import qc.common.core.utils.DateUtil;
import qc.module.qms.algorithm.NumericCalc.dto.QmsNumericCalcDest;
import qc.module.qms.algorithm.NumericCalc.dto.QmsNumericCalcInput;
import qc.module.qms.algorithm.NumericCalc.dto.QmsNumericCalcUseMethod;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * QMS数值计算方法--模拟方法，作为测试时返回模拟数据使用
 *
 * @author QuCheng Tech
 * @since 2025/9/10
 */
public class QmsNumericCalcMethodSimulate extends QmsNumericCalcMethodBase {
    private static final Logger logger = LoggerFactory.getLogger(QmsNumericCalcMethodSimulate.class);

    public QmsNumericCalcMethodSimulate(QmsNumericCalcDest dest, QmsNumericCalcUseMethod method, QmsNumericCalcInput input) {
        super(dest, method, input);
    }

    @Override
    public void calc() {
        logger.info("calc");

        //模拟测试数据
        //获取计算目标中的时段总数
        int tmCount = 0x9;
        Map<Date, Double> result = new HashMap<>();
        Date date = DateUtil.getNowDate();
        for (int i = 0; i <= tmCount; i++) {
            result.put(DateUtil.addHours(date, -i), 890.53 + i * 0.05);
        }
    }
}
